Skip to content

Add documentation for the dotnet build -t|--target option to dotnet-build.md.#53673

Open
classyk12 wants to merge 5 commits into
dotnet:mainfrom
classyk12:issue/53658-add-target-option-docs
Open

Add documentation for the dotnet build -t|--target option to dotnet-build.md.#53673
classyk12 wants to merge 5 commits into
dotnet:mainfrom
classyk12:issue/53658-add-target-option-docs

Conversation

@classyk12
Copy link
Copy Markdown

@classyk12 classyk12 commented May 10, 2026

Add documentation for the dotnet build -t|--target option to dotnet-build.md

Updated the dotnet build synopsis to include [-t|--target:]
Added a new options entry for -t|--target:
Included a short explanation and examples for using a specific MSBuild target
Added an example in the Examples section showing dotnet build -t:Clean

The dotnet build command accepts -t/--target, but the existing docs did not document it. This resolves missing documentation reported in issue #53658.

Verified the option syntax matches existing CLI documentation style
Confirmed the added examples are consistent with other dotnet build examples


Internal previews

📄 File 🔗 Preview link
docs/core/tools/dotnet-build.md dotnet build

Co-authored-by: Copilot <copilot@github.com>
@classyk12 classyk12 requested review from a team and meaghanlewis as code owners May 10, 2026 18:08
@dotnetrepoman dotnetrepoman Bot added this to the May 2026 milestone May 10, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-fundamentals/svc dotnet-cli/subsvc community-contribution Indicates PR is created by someone from the .NET community. labels May 10, 2026
@classyk12
Copy link
Copy Markdown
Author

@dotnet-policy-service agree

Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
@gewarren gewarren linked an issue May 11, 2026 that may be closed by this pull request
@gewarren gewarren requested a review from Copilot May 11, 2026 17:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the dotnet build command documentation to cover the -t|--target option, which lets you run specific MSBuild targets (such as Clean) instead of the default build target.

Changes:

  • Added -t|--target to the dotnet build synopsis.
  • Added a new Options entry describing -t|--target and provided example invocations.
  • Added an Examples entry showing dotnet build -t:Clean.

Comment thread docs/core/tools/dotnet-build.md
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment on lines +164 to +168
```dotnetcli
dotnet build -t:Clean
dotnet build -t:Rebuild
dotnet build -t:Clean;Build
```
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
@classyk12
Copy link
Copy Markdown
Author

All changes have been applied now. @gfoidl

Comment thread docs/core/tools/dotnet-build.md
@classyk12 classyk12 requested review from drewnoakes and gfoidl May 12, 2026 14:00
Copy link
Copy Markdown
Contributor

@adegeo adegeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! A few things to address.

Also, the dotnet run command has the same parameter support for -t|--target. We should update that article too.

Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md Outdated
Comment thread docs/core/tools/dotnet-build.md
@classyk12
Copy link
Copy Markdown
Author

Looking good! A few things to address.

Also, the dotnet run command has the same parameter support for -t|--target. We should update that article too.

Thats a good idea. whats the best way to go? Should this PR be merged first and then I can open a new PR for the dotnet-run.md addition for the -t|--target options?

@adegeo
Copy link
Copy Markdown
Contributor

adegeo commented May 14, 2026

Editing the file in this PR is fine. I also accidentally removed that link to the MSBuild Targets. Oops!

Additionally, please resolve the addressed comments that are in the review so that they unblock the PR.

Copy link
Copy Markdown
Author

@classyk12 classyk12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes have been made. This is ready to be passed to other reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-cli/subsvc dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"dotnet build -t" option is not documented

5 participants